// inputhandler.h
#ifndef INPUTHANDLER_H
#define INPUTHANDLER_H

#include <QObject>
#include <QWidget>
#include "gamecore.h"

class InputHandler : public QObject {
    Q_OBJECT

public:
    explicit InputHandler(QWidget *targetWidget, QObject *parent = nullptr);

    void setEnabled(bool enabled) { m_enabled = enabled; }

signals:
    void moveRequested(Direction direction);
    void resetRequested();
    void prevLevelRequested();
    void nextLevelRequested();

private:
    bool m_enabled = true;

protected:
    bool eventFilter(QObject *obj, QEvent *event) override;
};

#endif // INPUTHANDLER_H
